<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
	  xmlns:ui="http://java.sun.com/jsf/facelets"
	  xmlns:p="http://primefaces.org/ui"
	  xmlns:f="http://java.sun.com/jsf/core"
	  xmlns:composite="http://xmlns.jcp.org/jsf/composite">

	<composite:interface>
		<composite:attribute name="axis" required="true" type="org.plotfaces.model.Axis"/>
		<composite:attribute name="collapseHandler" required="true" type="org.plotfacesdemo.CollapseHandler"/>
		<composite:attribute name="plot" required="true" type="java.lang.String"/>
	</composite:interface>

    <composite:implementation>
		<!--
			All message resources should have the _axisTicks suffix.
		-->

		<p:panel id="axisTicks" closable="false" toggleable="true" collapsed="#{not cc.attrs.collapseHandler.isVisible('axisTicks')}" header="#{msg.ticks}">
			<p:ajax event="toggle" listener="#{cc.attrs.collapseHandler.handleToggle}" />
			<p:panelGrid id="axisTicksGrid" columns="3">
				<h:panelGroup>
					#{msg.tickDisplay_axisTicks}
				</h:panelGroup>
				<h:panelGroup>
					<p:selectBooleanButton offLabel="#{msg.hidden}" onLabel="#{msg.shown}" value="#{cc.attrs.axis.showTicks}" rendered="#{cc.attrs.axis.showTicks != null}">
						<p:ajax update="#{cc.attrs.plot}"/>
					</p:selectBooleanButton>

					<p:commandButton value="#{msg.initialize}" action="#{cc.attrs.axis.setShowTicks( true )}" rendered="#{cc.attrs.axis.showTicks == null}" update="axisTicksGrid #{cc.attrs.plot}"/>
					<p:commandButton value="#{msg.reset}" rendered="#{cc.attrs.axis.showTicks != null}" update="axisTicksGrid #{cc.attrs.plot}">
						<f:setPropertyActionListener target="#{cc.attrs.axis.showTicks}" value="#{null}" />
					</p:commandButton>
				</h:panelGroup>
				<h:panelGroup>
					#{msg.tickDisplay_axisTicks_notes}
				</h:panelGroup>

				<h:panelGroup>
					#{msg.tickCount_axisTicks}
				</h:panelGroup>
				<h:panelGroup>
					<p:spinner value="#{cc.attrs.axis.numberTicks}" rendered="#{cc.attrs.axis.numberTicks != null}">
						<p:ajax update="#{cc.attrs.plot}"/>
					</p:spinner>
					<p:commandButton value="#{msg.initialize}" action="#{cc.attrs.axis.setNumberTicks( 5 )}" update="#{cc.attrs.plot} axisTicksGrid" rendered="#{cc.attrs.axis.numberTicks == null}"/>
					<p:commandButton value="#{msg.reset}" update="#{cc.attrs.plot} axisTicksGrid" rendered="#{cc.attrs.axis.numberTicks != null}">
						<f:setPropertyActionListener target="#{cc.attrs.axis.numberTicks}" value="#{null}"/>
					</p:commandButton>
				</h:panelGroup>
				<h:panelGroup>
					#{msg.tickCount_axisTicks_notes}
				</h:panelGroup>

				<h:panelGroup>
					#{msg.tickInterval_axisTicks}
				</h:panelGroup>
				<h:panelGroup>
					<p:inputText value="#{cc.attrs.axis.tickInterval}" rendered="#{cc.attrs.axis.tickInterval != null}">
						<p:ajax update="#{cc.attrs.plot}"/>
						<f:convertNumber maxFractionDigits="0"/>
					</p:inputText>

					<p:commandButton value="#{msg.initialize}" action="#{cc.attrs.axis.setTickInterval( 1.0 )}" rendered="#{cc.attrs.axis.tickInterval == null}" update="axisTicksGrid #{cc.attrs.plot}"/>
					<p:commandButton value="#{msg.reset}" rendered="#{cc.attrs.axis.tickInterval != null}" update="axisTicksGrid #{cc.attrs.plot}" immediate="true">
						<f:setPropertyActionListener target="#{cc.attrs.axis.tickInterval}" value="#{null}" />
					</p:commandButton>
				</h:panelGroup>
				<h:panelGroup>
					#{msg.tickInterval_axisTicks_notes}
				</h:panelGroup>

				<h:panelGroup>
					#{msg.tickSpacing_axisTicks}
				</h:panelGroup>
				<h:panelGroup>
					<p:inputText value="#{cc.attrs.axis.tickSpacing}" rendered="#{cc.attrs.axis.tickSpacing != null}">
						<p:ajax update="#{cc.attrs.plot}"/>
						<f:convertNumber maxFractionDigits="0"/>
					</p:inputText>

					<p:commandButton value="#{msg.initialize}" action="#{cc.attrs.axis.setTickSpacing( 20.0 )}" rendered="#{cc.attrs.axis.tickSpacing == null}" update="axisTicksGrid #{cc.attrs.plot}"/>
					<p:commandButton value="#{msg.reset}" rendered="#{cc.attrs.axis.tickSpacing != null}" update="axisTicksGrid #{cc.attrs.plot}" immediate="true">
						<f:setPropertyActionListener target="#{cc.attrs.axis.tickSpacing}" value="#{null}" />
					</p:commandButton>
				</h:panelGroup>
				<h:panelGroup>
					#{msg.tickSpacing_axisTicks_notes}
				</h:panelGroup>

				<h:panelGroup>
					#{msg.tickMarks_axisTicks}
				</h:panelGroup>
				<h:panelGroup>
					<p:selectBooleanButton offLabel="#{msg.hidden}" onLabel="#{msg.shown}" value="#{cc.attrs.axis.showTickMarks}" rendered="#{cc.attrs.axis.showTickMarks != null}">
						<p:ajax update="#{cc.attrs.plot}"/>
					</p:selectBooleanButton>

					<p:commandButton value="#{msg.initialize}" action="#{cc.attrs.axis.setShowTickMarks( true )}" rendered="#{cc.attrs.axis.showTickMarks == null}" update="axisTicksGrid #{cc.attrs.plot}"/>
					<p:commandButton value="#{msg.reset}" rendered="#{cc.attrs.axis.showTickMarks != null}" update="axisTicksGrid #{cc.attrs.plot}">
						<f:setPropertyActionListener target="#{cc.attrs.axis.showTickMarks}" value="#{null}" />
					</p:commandButton>
				</h:panelGroup>
				<h:panelGroup>
					#{msg.tickMarks_axisTicks_notes}
				</h:panelGroup>

				<h:panelGroup>
					#{msg.minorTicks_axisTicks}
				</h:panelGroup>
				<h:panelGroup>
					<p:selectBooleanButton offLabel="#{msg.hidden}" onLabel="#{msg.shown}" value="#{cc.attrs.axis.showMinorTicks}" rendered="#{cc.attrs.axis.showMinorTicks != null}">
						<p:ajax update="#{cc.attrs.plot}"/>
					</p:selectBooleanButton>

					<p:commandButton value="#{msg.initialize}" action="#{cc.attrs.axis.setShowMinorTicks( true )}" rendered="#{cc.attrs.axis.showMinorTicks == null}" update="axisTicksGrid #{cc.attrs.plot}"/>
					<p:commandButton value="#{msg.reset}" rendered="#{cc.attrs.axis.showMinorTicks != null}" update="axisTicksGrid #{cc.attrs.plot}">
						<f:setPropertyActionListener target="#{cc.attrs.axis.showMinorTicks}" value="#{null}" />
					</p:commandButton>
				</h:panelGroup>
				<h:panelGroup>
					#{msg.minorTicks_axisTicks_notes}
				</h:panelGroup>

				<h:panelGroup>
					#{msg.syncTicks_axisTicks}
				</h:panelGroup>
				<h:panelGroup>
					<p:selectBooleanButton offLabel="#{msg.off}" onLabel="#{msg.on}" value="#{cc.attrs.axis.syncTicks}" rendered="#{cc.attrs.axis.syncTicks != null}">
						<p:ajax update="#{cc.attrs.plot}"/>
					</p:selectBooleanButton>

					<p:commandButton value="#{msg.initialize}" action="#{cc.attrs.axis.setSyncTicks( true )}" rendered="#{cc.attrs.axis.syncTicks == null}" update="axisTicksGrid #{cc.attrs.plot}"/>
					<p:commandButton value="#{msg.reset}" rendered="#{cc.attrs.axis.syncTicks != null}" update="axisTicksGrid #{cc.attrs.plot}">
						<f:setPropertyActionListener target="#{cc.attrs.axis.syncTicks}" value="#{null}" />
					</p:commandButton>
				</h:panelGroup>
				<h:panelGroup>
					#{msg.syncTicks_axisTicks_notes}
				</h:panelGroup>

				<h:panelGroup>
					#{msg.ticksArray_axisTicks}
				</h:panelGroup>
				<h:panelGroup>
					#{msg.notEditable}
				</h:panelGroup>
				<h:panelGroup>
					#{msg.ticksArray_axisTicks_notes}
				</h:panelGroup>
			</p:panelGrid>
		</p:panel>
	</composite:implementation>
</html>

